package com.chanel.iamframework.core.domain;

import java.util.ArrayList;
import java.util.List;

import javax.validation.constraints.NotNull;

public class User {
	
    private Long userId;

    private String userName;

    private Boolean isEnabled = true;

    private List<Group> groups = new ArrayList<Group>();
    
    private List<Application> applications = new ArrayList<Application>();
    
    private List<Role> roles = new ArrayList<Role>();
    
    public User() {}
    
    public User(String userName, Boolean isEnable) {
    	this.userName = userName;
    	this.isEnabled = isEnable;
    }
    
    public List<Role> getRoles() {
		return roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

	public List<Application> getApplications() {
		return applications;
	}

	public void setApplications(List<Application> applications) {
		this.applications = applications;
	}

	public List<Group> getGroups() {
		return groups;
	}

	public void setGroups(List<Group> groups) {
		this.groups = groups;
	}

	public User(String userName) {
    	this.userName = userName;
    }
    
    public Long getUserId() {
        return userId;
    }

    public void setUserId(@NotNull Long userId) {
        this.userId = userId;
    }

    @NotNull 
    public String getUserName() {
        return userName;
    }

    public void setUserName(@NotNull String userName) {
        this.userName = userName;
    }

    public Boolean getIsEnabled() {
        return isEnabled;
    }

    public Boolean isEnabled() {
        return getIsEnabled();
    }

    public void setIsEnabled(Boolean isEnabled) {
        this.isEnabled = isEnabled;
    }
    
    @Override
    public String toString() {
    	return "User ==> {" +
    			"userId = " + userId +
    			", userName = " + userName +
    			", isEnabled = " + isEnabled +
    			"}";
    }
}